package com.xiyoukt.springboot.controller;

import com.xiyoukt.springboot.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class IndexController {

    @Autowired
    private Person person;

    @GetMapping("index")
    public String index(HttpServletRequest request){
        request.setAttribute("person", person);
        return "index";
    }

}
